<%-- 
    Document   : bookreview
    Created on : Sep 20, 2011, 8:44:51 PM
    Author     : Quangtv
--%>

<%@page import="java.net.URL"%>
<%@page import="java.io.File"%>
<%@page import="org.apache.jasper.tagplugins.jstl.core.Url"%>
<%@page import="Assignment.BLO.BookBLO"%>
<%@page import="Assignment.BLO.UserBLO"%>
<%@page import="java.io.InputStream"%>
<%@page import="java.util.Properties"%>
<%@page import="Assignment.Util.ConnectionUtil"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Book review</title>
        <link href="css/style.css" rel="stylesheet" type="text/css"/>
        <link href="css/bannerstyle.css" rel="stylesheet" type="text/css"/>
        <link href="css/TableCSS.css" rel="stylesheet" type="text/css"/>
        <link href="css/thumbnail_css.css" rel="stylesheet" type="text/css"/>

        <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

        <script type="text/javascript">
            function setVisibility(showUser, isAdmin){
                if(showUser == "true"){
                    document.getElementById("user").style.visibility = "visible";
                    document.getElementById("loggeduser").style.visibility = "hidden";
                }else if(showUser == "false" && isAdmin == "true"){
                    document.getElementById("loggeduser").style.visibility = "visible";
                    document.getElementById("user").style.visibility = "hidden";
                    document.getElementById("user_link").textContent = "| Admin";
                    document.getElementById("user_link").href = "admin.jsp";
                }else if(showUser == "false" && isAdmin == "false"){
                    document.getElementById("loggeduser").style.visibility = "visible";
                    document.getElementById("user").style.visibility = "hidden";
                    document.getElementById("user_link").textContent = "| View Cart";
                    document.getElementById("user_link").href = "viewcart.jsp";
                }
            }
            function checkSearch(){
                if (document.getElementById("searchText").value.toString().length == 0){
                    alert("Must input somrthing!")
                    return false;
                }else{
                    return true;
                }
            }
        </script>
        <%
                    //check and set username
                    String loggedUser = (String) session.getAttribute("USER");
                    String showUser = "";
                    String isAdmin = "";
                    if (loggedUser == null) {
                        showUser = "true";
                    } else {
                        showUser = "false";
                        isAdmin = (String) session.getAttribute("ISADMIN");
                        if (isAdmin == null || isAdmin == "false") {
                            isAdmin = "false";
                        } else {
                            isAdmin = "true";
                        }
                    }
        %>
    </head>
    <body onload='setVisibility("<%=showUser%>","<%=isAdmin%>")'>
        <c:import var="bookxml" url="${sessionScope.BOOKURL}"/>
        <x:parse var="doc" xml="${bookxml}" scope="session"/>
        <c:import var="newbookxml" url="${sessionScope.NEWBOOKURL}"/>
        <x:parse var="newdoc" xml="${newbookxml}" scope="session"/>
        <c:set var="search" value="${param.searchText}"/>

        <div id="header-wrap">
            <div id="header">
                <div style="margin:0px; text-align: left; float: left;"> <span style="color: #FFFFFF; font-family:'Arial Black',Gadget,sans-serif; font-size: 20px; font-weight: bold; letter-spacing: -2px;"><a href="index.jsp" style="color: #FFF; text-decoration: none;" title="Awesomebooks.com">AWESOMEBOOKS</a></span> <a style="color: #FFF; font-size: 18px; font-family: Georgia, 'Times New Roman', Times, serif; font-style:italic; font-weight:normal; text-decoration: none;" href="index.jsp" title="Find your own book">Find your own book</a> 	</div>
                <ul class="menu">

                    <!-- Begin Simple Item Without Drop -->
                    <li class="">
                        <a href="newrelease.jsp">New Release</a>
                    </li>
                    <li class="">
                        <a href="bestseller.jsp">Best Seller</a>
                    </li>
                    <li class="">
                        <a href="bookreview.jsp">Books Review</a>
                    </li>

                    <li class="drop">
                        <a href="#">Catalogs</a>
                        <span class="toggle">&nbsp;</span>
                        <ul>
                            <li><a href="Controller?Action=Search&searchText=literature&Category=true">Literature</a></li>
                            <li><a href="Controller?Action=Search&searchText=life style&Category=true">Life Style</a></li>
                            <li><a href="Controller?Action=Search&searchText=tutorial&Category=true">Tutorial</a></li>
                            <li><a href="Controller?Action=Search&searchText=discovery&Category=true">Discovery</a></li>
                            <li><a href="Controller?Action=Search&searchText=science&Category=true">Science</a></li>
                            <li><a href="Controller?Action=Search&searchText=kids&Category=true">Kids</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
            <div id="underheader">
                <form action="Controller" onsubmit="return checkSearch()" method="POST">

                    <span id="searchbox" style="width:50%">

                        <input id="searchText" name="searchText" type="text" style="width:250px; border:1px solid #333333" />
                        <input name="Action" type="submit" value="Search" id="button" />

                    </span>
                    <span id="user" style="width:25%">
                        <a href="login.jsp">Login</a> |
                        <a href="register.jsp">Register</a>
                    </span>
                    <span id="loggeduser" style="width:25%;position: relative; left: -180px; visibility: hidden">
                        <a><%=loggedUser%></a>
                        <a href="Controller?Action=Logout">(Logout)</a>
                        <a id="user_link" href="viewcart.jsp">| View Cart</a>
                    </span>
                </form>
            </div>
        </div>
        <center>
            <div id="banner">
                <img alt="" height="380" src="images/bestseller.jpg" width="800" style="padding:2px"/></div>

            <div id="content-header" style="height: 50px">
                <ul>
                    <a href="#">Book in review this week</a>
                </ul>
            </div>
            <form id="content" style="text-align: left">
                <br/>
                <center>
                <img src="covers/unbroken.jpg" width="300" height="455" alt="Unbroken"/><br/><br/>
                <a href="bookdetail.jsp?bookID=1" style="text-decoration: blink; color: white">Buy on Awesomebooks</a><br/><br/>
                </center>

                <div style="font-weight: bolder; color:khaki; text-align: left">- Unbroken: A World War II Story of Survival, Resilience, and Redemption</div>
                <a style="color: #FFFFFF; font-style: italic">- Best book of the month 9/2011</a>
                <div style="color: #FFFFFF; font: 100 medium sans-serif; text-align: justify; position: relative; left: 20px; width: 90%">
                    From Laura Hillenbrand, the bestselling author of Seabiscuit, comes Unbroken, the inspiring true story of a man who lived through a series of catastrophes almost too incredible to be believed. In evocative, immediate descriptions, Hillenbrand unfurls the story of Louie Zamperini--a juvenile delinquent-turned-Olympic runner-turned-Army hero. During a routine search mission over the Pacific, Louie’s plane crashed into the ocean, and what happened to him over the next three years of his life is a story that will keep you glued to the pages, eagerly awaiting the next turn in the story and fearing it at the same time. You’ll cheer for the man who somehow maintained his selfhood and humanity despite the monumental degradations he suffered, and you’ll want to share this book with everyone you know. --Juliet Disparte
<br/><br/>
<a style="font-weight: bold; color: palegoldenrod">The Story of Unbroken by Laura Hillenbrand</a>
<br/><br/>
Eight years ago, an old man told me a story that took my breath away. His name was Louie Zamperini, and from the day I first spoke to him, his almost incomprehensibly dramatic life was my obsession.
<br/><br/>
It was a horse--the subject of my first book, Seabiscuit: An American Legend--who led me to Louie. As I researched the Depression-era racehorse, I kept coming across stories about Louie, a 1930s track star who endured an amazing odyssey in World War II. I knew only a little about him then, but I couldn’t shake him from my mind. After I finished Seabiscuit, I tracked Louie down, called him and asked about his life. For the next hour, he had me transfixed.
<br/><br/>
Growing up in California in the 1920s, Louie was a hellraiser, stealing everything edible that he could carry, staging elaborate pranks, getting in fistfights, and bedeviling the local police. But as a teenager, he emerged as one of the greatest runners America had ever seen, competing at the 1936 Berlin Olympics, where he put on a sensational performance, crossed paths with Hitler, and stole a German flag right off the Reich Chancellery. He was preparing for the 1940 Olympics, and closing in on the fabled four-minute mile, when World War II began. Louie joined the Army Air Corps, becoming a bombardier. Stationed on Oahu, he survived harrowing combat, including an epic air battle that ended when his plane crash-landed, some six hundred holes in its fuselage and half the crew seriously wounded.
<br/><br/>
On a May afternoon in 1943, Louie took off on a search mission for a lost plane. Somewhere over the Pacific, the engines on his bomber failed. The plane plummeted into the sea, leaving Louie and two other men stranded on a tiny raft. Drifting for weeks and thousands of miles, they endured starvation and desperate thirst, sharks that leapt aboard the raft, trying to drag them off, a machine-gun attack from a Japanese bomber, and a typhoon with waves some forty feet high. At last, they spotted an island. As they rowed toward it, unbeknownst to them, a Japanese military boat was lurking nearby. Louie’s journey had only just begun.
<br/><br/>
That first conversation with Louie was a pivot point in my life. Fascinated by his experiences, and the mystery of how a man could overcome so much, I began a seven-year journey through his story. I found it in diaries, letters and unpublished memoirs; in the memories of his family and friends, fellow Olympians, former American airmen and Japanese veterans; in forgotten papers in archives as far-flung as Oslo and Canberra. Along the way, there were staggering surprises, and Louie’s unlikely, inspiring story came alive for me. It is a tale of daring, defiance, persistence, ingenuity, and the ferocious will of a man who refused to be broken.
<br/><br/>
The culmination of my journey is my new book, Unbroken: A World War II Story of Survival, Resilience, and Redemption. I hope you are as spellbound by Louie’s life as I am.
<br/>
                </div>
            </form>

        </center>
    </body>
</html>

